import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'styleCommon.dart';

class NoTask extends StatelessWidget {
  final String title;
  final String subTitle;
  NoTask(this.title, this.subTitle);
  @override
  Widget build(BuildContext context) {
    print('this');
    return getChatTemplate();
  }

  Widget getChatTemplate() {
    return //通过ConstrainedBox来确保Stack占满屏幕
        ConstrainedBox(
      constraints: BoxConstraints.expand(),
      child: Stack(
        alignment: Alignment.center, //指定未定位或部分定位widget的对齐方式
        children: <Widget>[
          Column(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Image(
                image: AssetImage("images/no_thing.png"),
                width: 165,
                height: 110,
              ),
              SizedBox(
                height: 15,
              ),
              Text(
                title,
                style: fontStyle3,
              ),
              SizedBox(
                height: 2,
              ),
              Text(
                subTitle,
                style: fontStyle2,
              ),
            ],
          )
        ],
      ),
    );
  }
}
